(unrmail): If "Mail-From" header is found, append a newline to it.
authorEli Zaretskii <eliz@gnu.org>
Fri, 10 Apr 2009 11:53:59 +0000 (11:53 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 10 Apr 2009 11:53:59 +0000 (11:53 +0000)
lisp/mail/unrmail.el

index bb73b82c9eff29b65fb23ab228d23ab0eb2d606f..cd71ec58571dcb3524c808684f725c35f9da2b06 100644 (file)
@@ -191,7 +191,13 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'."
               (save-excursion (search-forward "\n\n" nil 'move) (point)))
 
              ;; Fetch or construct what we should use in the `From ' line.
-             (setq mail-from (or (mail-fetch-field "Mail-From")
+             (setq mail-from (or (let ((from (mail-fetch-field "Mail-From")))
+                                   ;; mail-mbox-from (below) returns a
+                                   ;; string that ends in a newline, but
+                                   ;; but mail-fetch-field does not, so
+                                   ;; we append a newline here.
+                                   (if from
+                                       (format "%s\n" from)))
                                  (mail-mbox-from)))
 
              ;; If the message specifies a coding system, use it.
@@ -213,7 +219,7 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'."
 
            (goto-char (point-min))
            ;; Insert the `From ' line.
-           (insert mail-from "\n")
+           (insert mail-from)
            ;; Record the keywords and attributes in our special way.
            (insert "X-RMAIL-ATTRIBUTES: " (apply 'string attrs) "\n")
            (when keywords